home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / asm32.zip / E32.ZIP / SCRNCOLS.ASM < prev    next >
Assembly Source File  |  1996-03-30  |  2KB  |  103 lines

  1. ; SCRNCOLS.ASM for E32 - Copyright (C) 1994 - 1996 Douglas Herr
  2. ;  all rights reserved
  3.  
  4. ; change screen columns on most systems
  5.  
  6. ; 01/18/1996 DH: changed PICKSTR calls to PICKSTRING
  7.  
  8. include    model.inc
  9.  
  10. public    screen_columns
  11. extrn    set_screen_dimensions:near
  12. extrn    htext:near, hram8043:near, hram9025:near, hram9043:near
  13. extrn    cursoroff:near, getcrt:near
  14. extrn    $tpick:near, pickstring:near
  15. extrn    get_screen_data:near
  16.  
  17. include    dataseg.inc
  18. extrn    rows:word, columns:byte
  19.  
  20. coldata    dw 40
  21.     dw 80
  22.     dw 132
  23.  
  24. herc_dispatch    dd hram8043
  25.         dd hram9043
  26.         dd htext
  27.         dd hram9025
  28.  
  29. hercmsg    db '80 columns',0
  30.     db '90 columns',0
  31.     db 0
  32. ega_msg    db '40 columns',0
  33. evmono    db '80 columns',0
  34. ega132    db '132 columns',0
  35.     db 0
  36. egamono    dw 0
  37. @curseg    ends
  38.  
  39. include    codeseg.inc
  40. screen_columns    proc    near
  41.     push    word ptr ega132
  42.     call    cursoroff
  43.     call    getcrt
  44.     mov    byte ptr egamono,ah
  45.     xor    ebx,ebx
  46.     mov    dx,0707h
  47.     cmp    al,0FFh        ; CGA?
  48.     je    short cga
  49.     cmp    al,128        ; RamFont?
  50.     ja    short herc
  51.     cmp    al,1
  52.     je    short evga
  53.     cmp    al,3
  54.     je    short evga
  55. ;    cmp    ax,0100h
  56. ;    jne    short exit
  57. ; EGA monochrome OK if Everex
  58. ;    lea    si,evmono
  59. ;    cmp    ax,0102h    ; is it everex?
  60. ;    jne    short exit
  61. jmp    short exit
  62. ;    inc    egamono
  63. ;    jmp    short ev1
  64. evga:
  65.     lea    esi,ega_msg
  66. ev1:    mov    ebx,1
  67.     mov    eax,offset @curseg:$tpick
  68.     call    pickstring
  69.     cmp    al,27
  70.     je    short exit
  71.     add    bx,egamono
  72.     mov    bx,coldata[ebx*2]
  73.     mov    ax,rows
  74.     add    ax,2
  75.     call    set_screen_dimensions
  76.     jmp    short screen_data
  77.  
  78. cga:    mov    ega132,0    ; disable 132-column display
  79.     jmp    short evga
  80.     
  81. herc:    lea    esi,hercmsg
  82.     mov    eax,offset @curseg:$tpick
  83.     call    pickstring
  84.     cmp    ax,27
  85.     je    short exit
  86. ;    shl    ebx,2
  87.     cmp    rows,40
  88.     sbb    eax,eax        ; AX = 0FFFFh if 25 rows
  89.     and    eax,8
  90. ;    add    ebx,eax
  91.     call    herc_dispatch[eax+ebx*4]
  92.  
  93. screen_data:
  94.     call    get_screen_data
  95. exit:
  96.     pop    word ptr ega132
  97.     clc
  98.     ret
  99. screen_columns    endp
  100.  
  101. @curseg    ends
  102.     end
  103.